package com.goldcn.order.controller;

import com.goldcn.order.service.OrderDeleteService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2017/6/6.
 */
@Api(value = "订单utility")
@RestController
@RequestMapping(value = "/orderUtil")
public class OrderDeleteController {
    @Autowired
    OrderDeleteService orderDeleteService;

    @ApiOperation(value = "根据orderIdList删除订单")
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    public Object deleteOrder(@RequestBody List<Long> list) {
        return orderDeleteService.deleteOrderAndItem(list);
    }


    @ApiOperation(value = "重建运保费index")
    @RequestMapping(value = "/freightIndex", method = RequestMethod.POST)
    public Object buildPaymentByPointFreight() {
        return orderDeleteService.buildPaymentByPointFreight();
    }

}
